package com.njbdqn.mydemo.services;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.njbdqn.mydemo.dao.IStudentsDAO;
import com.njbdqn.mydemo.vo.Students;

@Service
@Transactional
public class StudentService {
	@Autowired
	private IStudentsDAO sdao;
	
	public synchronized String getNewName(String oldName){
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmss");
		return sdf.format(new Date())
				+oldName.substring(oldName.lastIndexOf("."));
	}
	
	public void saveStu(Students stu){
		sdao.saveStu(stu);
	}

}
